<!--查看商家-->
<template>
  <ele-modal
    class="el-model"
    width="685px"
    title="查看商家"
    :visible="visible"
    custom-class="demo-file-sort-dialog"
    @update:visible="updateVisible"
  >
  <el-card shadow="never" v-if="visible==true">
    <div class="flex-between m-bottom20">
      <div class="fit-title">商家列表</div>
    </div>
    <el-table
      max-height="273px"
      :data="tableData"
      ref="table"
      tooltip-effect="dark"
      border
      stripe>
      <el-table-column  label="商家编号" align="center" prop="merchantCode">
      </el-table-column>
      <el-table-column label="商家名称" prop="merchantName">
      </el-table-column>
      <el-table-column label="有效时间" prop="prescription">
      </el-table-column>
      <el-table-column label="点数" prop="counts">
      </el-table-column>
      <el-table-column label="状态">
        <template slot-scope="scope">
          <div v-if="scope.row.status">{{scope.row.status==1 ? '启动' : '冻结'}}</div>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
  </ele-modal>
</template>

<script>
  import {oemMerchantId} from '@/api/merchantAccount'
  export default {
    name: "prize",
    props:{
      visible:Boolean,
    },
    data() {
      return {
        // 上传背景图片url
        fileList:[],
        // 背景图
        imageUrl: '',
        list:[],
        tableData: []
      }
    },
    created(){
      // this.init()
    },
    methods:{
      init(row){
        console.log("this.data",this.data)
        oemMerchantId({
          oemId:row.id,
          limit:10,
          page:1
        })
          .then((data) => {
            this.tableData=data.list
            console.log("data",data)
        })
          .catch((e) => {
            this.$message.error(e.msg);
          });
      },

      /* 更新visible */
      updateVisible(value) {
        this.$emit('update:visible', value);
      }
    }
  }
</script>

<style scoped lang="less">
  .fit-title{
    color: #333333;
    font-size: 16px;
    margin:0px 2px;
  }
  .tj-class{
    margin: 30px 10px 0;
  }
  .avatar-uploader{
    margin: 0;
    padding: 0;
    outline: none;

    /* 修改 start*/
    border: 1px solid #D9D9D9;
    border-radius: 2px;
    /*end*/
    width: 88px;
    height: 88px;
  }
  /*  ‘背景图’上传 start */
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    color: #D9D9D9;
    text-align: center;
    i{
      font-size: 28px;
    }
    div{
      padding-top: 3px;
    }
  }
  .avatar {
    width: 90px;
    height: 90px;
    display: block;
  }
/*  end*/
</style>
